package com.situ.mall.common.mapper;

import com.situ.mall.common.entity.Category;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.situ.mall.common.vo.CategoryVO;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author membergpf
 * @since 2023-03-20
 */
public interface CategoryMapper extends BaseMapper<Category> {
    @Select("select * from category where parent_id=#{id}")
    List<Category> selectByParentId(Integer id);

    List<Category> firstName();

    List<Category> secondName(Integer id);

    List<CategoryVO> indexList();


@Select("select * from category where parent_id =#{i} order by sequence desc limit 0,8")
    List<Category> list8(int i);
}
